from random import randint
from sets import Set

def main():
    input_file = '/home/ivy/workspace/git/Social/Social/file/user.txt'
    output_file = '/home/ivy/workspace/git/Social/Social/file/user_sampling.txt'
    f = open(output_file, 'w')
    
    users = Set([])
    count = 0
    with open(input_file) as hello_file:
        for line in hello_file:
            t = randint(1,5)
            if(t == 3 and line not in users):
                f.write(line)
                users.add(line)
                count += 1
    
    print(count)
    
    
if __name__ == '__main__':
    main() 